using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._LocationReferencingTools
{
    /// <summary>
    /// <para>Append Events</para>
    /// <para>Appends event records from a table, layer, or feature class to an existing ArcGIS Location Referencing event feature class.</para>
    /// <para>将表、图层或要素类中的事件记录追加到现有 ArcGIS Location Referencing 事件要素类。</para>
    /// </summary>    
    [DisplayName("Append Events")]
    public class AppendEvents : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AppendEvents()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Event</para>
        /// <para>The source event records to append.</para>
        /// <para>要追加的源事件记录。</para>
        /// </param>
        /// <param name="_in_target_event">
        /// <para>Target Event</para>
        /// <para>The Location Referencing event layer or feature class into which the source event records will be appended.</para>
        /// <para>将追加源事件记录的 Location Referencing 事件图层或要素类。</para>
        /// </param>
        /// <param name="_field_mapping">
        /// <para>Field Map</para>
        /// <para><xdoc>
        ///   <para>Controls how the attribute information in fields of the Input Event is transferred to the Target Event.</para>
        ///   <para>Because the data of the Input Event is appended into an existing event that has a predefined schema (field definitions), fields cannot be added or removed from the target dataset. While you can set merge rules for each output field, the tool ignores those rules.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>控制如何将输入事件字段中的属性信息传输到目标事件。</para>
        ///   <para>由于输入事件的数据将追加到具有预定义架构（字段定义）的现有事件中，因此无法在目标数据集中添加或删除字段。虽然您可以为每个输出字段设置合并规则，但该工具会忽略这些规则。</para>
        /// </xdoc></para>
        /// </param>
        public AppendEvents(object _in_dataset, object _in_target_event, object _field_mapping)
        {
            this._in_dataset = _in_dataset;
            this._in_target_event = _in_target_event;
            this._field_mapping = _field_mapping;
        }
        public override string ToolboxName => "Location Referencing Tools";

        public override string ToolName => "Append Events";

        public override string CallName => "locref.AppendEvents";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_dataset, _in_target_event, _field_mapping, _load_type.GetGPValue(), _generate_event_ids.GetGPValue(), _generate_shapes.GetGPValue(), _out_target_event, _out_details_file];

        /// <summary>
        /// <para>Input Event</para>
        /// <para>The source event records to append.</para>
        /// <para>要追加的源事件记录。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Event")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Target Event</para>
        /// <para>The Location Referencing event layer or feature class into which the source event records will be appended.</para>
        /// <para>将追加源事件记录的 Location Referencing 事件图层或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Event")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_target_event { get; set; }


        /// <summary>
        /// <para>Field Map</para>
        /// <para><xdoc>
        ///   <para>Controls how the attribute information in fields of the Input Event is transferred to the Target Event.</para>
        ///   <para>Because the data of the Input Event is appended into an existing event that has a predefined schema (field definitions), fields cannot be added or removed from the target dataset. While you can set merge rules for each output field, the tool ignores those rules.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>控制如何将输入事件字段中的属性信息传输到目标事件。</para>
        ///   <para>由于输入事件的数据将追加到具有预定义架构（字段定义）的现有事件中，因此无法在目标数据集中添加或删除字段。虽然您可以为每个输出字段设置合并规则，但该工具会忽略这些规则。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Map")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field_mapping { get; set; }


        /// <summary>
        /// <para>Load Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how appended events with measure or temporality overlaps with identical Event IDs as Target Event records will be loaded into the event feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>Add—Appends the Input Event records to the Target Event. No changes are made to Target Event records.</bullet_item><para/>
        ///     <bullet_item>Retire overlaps—Appends the Input Event records to the Target Event and retires any records in the Target Event with measure or temporality overlaps as the appended events. If the appended event eclipses the Target Event, the Target Event will be deleted. This option should only be used for linear events.</bullet_item><para/>
        ///     <bullet_item>Retire by event ID—Appends the Input Event records to the Target Event and retires any records in the Target Event with the same Event ID and temporality overlaps as the appended events. If the appended event eclipses a Target Event with the same Event ID, the Target Event will be deleted.</bullet_item><para/>
        ///     <bullet_item>Replace by event ID—Appends the Input Event records to the Target Event and deletes any records in the Target Event with the same Event ID as the appended events.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何将具有度量或时态的追加事件与与目标事件记录相同的事件 ID 重叠加载到事件要素类中。</para>
        ///   <bulletList>
        ///     <bullet_item>添加 （Add） - 将输入事件记录追加到目标事件。不会对目标事件记录进行任何更改。</bullet_item><para/>
        ///     <bullet_item>停用重叠 - 将输入事件记录追加到目标事件，并停用目标事件中任何度量或时间重叠的记录。如果附加的事件使目标事件黯然失色，则目标事件将被删除。此选项应仅用于线性事件。</bullet_item><para/>
        ///     <bullet_item>按事件 ID 停用 - 将输入事件记录追加到目标事件，并停用目标事件中与追加事件具有相同事件 ID 且时间重叠的任何记录。如果附加的事件使具有相同事件 ID 的目标事件黯然失色，则目标事件将被删除。</bullet_item><para/>
        ///     <bullet_item>替换为事件 ID - 将“输入事件”记录追加到“目标事件”，并删除“目标事件”中与附加事件具有相同事件 ID 的所有记录。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Load Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _load_type_value _load_type { get; set; } = _load_type_value._ADD;

        public enum _load_type_value
        {
            /// <summary>
            /// <para>Add</para>
            /// <para>Add—Appends the Input Event records to the Target Event. No changes are made to Target Event records.</para>
            /// <para>添加 （Add） - 将输入事件记录追加到目标事件。不会对目标事件记录进行任何更改。</para>
            /// </summary>
            [Description("Add")]
            [GPEnumValue("ADD")]
            _ADD,

            /// <summary>
            /// <para>Retire overlaps</para>
            /// <para>Retire overlaps—Appends the Input Event records to the Target Event and retires any records in the Target Event with measure or temporality overlaps as the appended events. If the appended event eclipses the Target Event, the Target Event will be deleted. This option should only be used for linear events.</para>
            /// <para>停用重叠 - 将输入事件记录追加到目标事件，并停用目标事件中任何度量或时间重叠的记录。如果附加的事件使目标事件黯然失色，则目标事件将被删除。此选项应仅用于线性事件。</para>
            /// </summary>
            [Description("Retire overlaps")]
            [GPEnumValue("RETIRE_OVERLAPS")]
            _RETIRE_OVERLAPS,

            /// <summary>
            /// <para>Retire by event ID</para>
            /// <para>Retire by event ID—Appends the Input Event records to the Target Event and retires any records in the Target Event with the same Event ID and temporality overlaps as the appended events. If the appended event eclipses a Target Event with the same Event ID, the Target Event will be deleted.</para>
            /// <para>按事件 ID 停用 - 将输入事件记录追加到目标事件，并停用目标事件中与追加事件具有相同事件 ID 且时间重叠的任何记录。如果附加的事件使具有相同事件 ID 的目标事件黯然失色，则目标事件将被删除。</para>
            /// </summary>
            [Description("Retire by event ID")]
            [GPEnumValue("RETIRE_BY_EVENT_ID")]
            _RETIRE_BY_EVENT_ID,

            /// <summary>
            /// <para>Replace by event ID</para>
            /// <para>Replace by event ID—Appends the Input Event records to the Target Event and deletes any records in the Target Event with the same Event ID as the appended events.</para>
            /// <para>替换为事件 ID - 将“输入事件”记录追加到“目标事件”，并删除“目标事件”中与附加事件具有相同事件 ID 的所有记录。</para>
            /// </summary>
            [Description("Replace by event ID")]
            [GPEnumValue("REPLACE_BY_EVENT_ID")]
            _REPLACE_BY_EVENT_ID,

        }

        /// <summary>
        /// <para>Generate Event ID GUIDs for loaded events</para>
        /// <para><xdoc>
        ///   <para>Specifies whether event IDs will be generated for Input Event records being appended. Generation of event IDs will only be applied to Input Event records with a Null value for the Event ID field.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Generates event IDs for the Input Event records being appended.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Does not generate event IDs for the Input Event records being appended. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否为追加的输入事件记录生成事件 ID。事件 ID 的生成将仅应用于“事件 ID”字段的“输入事件”记录，其值为 Null。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 为要追加的输入事件记录生成事件 ID。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不为要追加的输入事件记录生成事件 ID。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Generate Event ID GUIDs for loaded events")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _generate_event_ids_value _generate_event_ids { get; set; } = _generate_event_ids_value._false;

        public enum _generate_event_ids_value
        {
            /// <summary>
            /// <para>NO_GENERATE_EVENT_IDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_GENERATE_EVENT_IDS")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>GENERATE_EVENT_IDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("GENERATE_EVENT_IDS")]
            [GPEnumValue("true")]
            _true,

        }

        /// <summary>
        /// <para>Generate Shapes</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the shapes of the records being appended will be regenerated. This parameter is only active when the Input Event is a feature layer or feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The shapes of the input event features will be regenerated. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The shapes of the input event features will not be regenerated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否要重新生成要追加的记录的形状。仅当输入事件为要素图层或要素类时，此参数才处于活动状态。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将重新生成输入事件要素的形状。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会再生输入事件要素的形状。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Generate Shapes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _generate_shapes_value _generate_shapes { get; set; } = _generate_shapes_value._true;

        public enum _generate_shapes_value
        {
            /// <summary>
            /// <para>GENERATE_SHAPES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("GENERATE_SHAPES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SHAPES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SHAPES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Target Event</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Target Event")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_target_event { get; set; }


        /// <summary>
        /// <para>Output Results File</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Results File")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_details_file { get; set; }


        public AppendEvents SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}